import { CHART_BAR_CONFIG } from "./types/bar";

export const CHART_CONFIG_MAPS = {
    yAxis: {
        label: "Y轴",
        value: "yAxis"
    },
    xAxis: {
        label: "X轴",
        value: "xAxis"
    }
};

const AxisTypeLists = [
    {
        value: "value",
        label: "数值轴",
        desc: "适用于连续数据"
    },
    {
        value: "category",
        label: "类目轴",
        desc: "适用于离散的类目数据。为该类型时类目数据可自动从 series.data 或 dataset.source 中取，或者可通过 xAxis.data 设置类目数据"
    },
    {
        value: "time",
        label: "时间轴",
        desc: "适用于连续的时序数据，与数值轴相比时间轴带有时间的格式化，在刻度计算上也有所不同，例如会根据跨度的范围来决定使用月，星期，日还是小时范围的刻度"
    },
    {
        value: "log",
        label: "对数轴",
        desc: "适用于对数数据"
    },
];

export const CHART_TYPES_MAP = {
    xAxis: {
        show:{
            label: "显示X轴",
            value: "show"
        },
        type: {
            label: "坐标轴类型",
            value: "type",
            dropLists: AxisTypeLists
        },
        data:{
            label: "类目数据",
            value: "data"
        }
    },
    yAxis: {
        show:{
            label: "显示Y轴",
            value: "show"
        },
        type: {
            label: "坐标轴类型",
            value: "type",
            dropLists: AxisTypeLists
        },
        data:{
            label: "类目数据",
            value: "data"
        }
    },
    series:{
        type: {
            label: "图表类型",
            value: "type"
        },
        data:{
            label: "具体的数据项",
            value: "data"
        }
    }
};

export const CHART_SERIES_TYPES = {
    bar: CHART_BAR_CONFIG
}
